<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8" />
    <title>根据城市设置城市中心点</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <style>
      body,
      html,
      #container {
        overflow: hidden;
        width: 100%;
        height: 100%;
        margin: 0;
        font-family: '微软雅黑';
      }
    </style>
    <script src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=5NCjqMrEYzisdYwAhyp82hnzfVDOZTa4"></script>
  </head>
  <body>
    <div id="container"></div>
  </body>
</html>
<script>
  var map = new BMapGL.Map('container') // 创建Map实例
  map.centerAndZoom('上海市', 12) // 初始化地图,设置中心点坐标和地图级别
  map.enableScrollWheelZoom(true) // 开启鼠标滚轮缩放
  
</script>
